home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / mus / edit / OctamedSS1.03c.lha / Soundstudio / Rexx / omed.lha / rexx / SwapTracks.omed < prev   
Text File  |  1996-06-06  |  1KB  |  39 lines

  1. /* Swap Tracks */
  2. signal on failure
  3. 'pl_stop'
  4. 'ed_getcurrtrack var currtrack'
  5. 'ed_getnumtracks var numtracks'
  6. 'ed_getnumblocks var numblocks'
  7. if ~open(win,'con:150/150/200/1/SwapTracks/close/screen OCTAMED',w) then exit
  8. call writeln(win,'Destination Track (0-'numtracks-1'):')
  9. desttrack=readln(win)
  10. call writeln(win,'Start Block (0-'numblocks-1'):')
  11. startblock=readln(win)
  12. call writeln(win,'End Block ('startblock'-'numblocks-1'):')
  13. endblock=readln(win)
  14. call close(win)
  15. select
  16.     when desttrack=currtrack then do; 'wi_request "You ARE on this track, man ...." "Oh..."'; exit; end
  17.     when desttrack<0 | desttrack="" | startblock<0 | startblock>numblocks-1| startblock>endblock | endblock<0 | endblock>numblocks-1 then exit
  18. otherwise
  19. end
  20. op_update off
  21. 'ed_goto block' startblock
  22. do until startblock-1=endblock
  23.     wi_showstring "Block: " endblock
  24.     'ed_goto block' endblock
  25.     'rn_cut track'
  26.     'ed_goto track' desttrack
  27.     'rn_swap track'
  28.     'ed_goto track' currtrack
  29.     'rn_paste track'
  30.     endblock=endblock-1
  31. end
  32. op_update on
  33. wi_showstring "Swapped."
  34. exit
  35.  
  36. failure:
  37. signal off failure
  38. wi_showstring 'No characters! You entered: DestTrack: 'desttrack 'StartBlock 'startblock 'EndBlock '
  39. /* last line will probably _never_ be reached; don't kill it anyway */